{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets, manifold, manifold"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MDS 要求降维后 样本之间的距离得到保持"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 使用sklearn自带的鸢尾花分类数据\n",
    "def load_data():\n",
    "    iris = datasets.load_iris()\n",
    "    return iris.data,iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def test_MDS(*data):\n",
    "    x,y = data\n",
    "    for n in (4,3,2,1):\n",
    "        mds = manifold.MDS(n_components=n)\n",
    "        mds.fit(x)\n",
    "        # 显示核化矩阵的特征值λ\n",
    "        print('stress(n_components={0}) :{1}'.format(n,str(mds.stress_)))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stress(n_components=4) :11.73184624909949\n",
      "stress(n_components=3) :15.742512147755116\n",
      "stress(n_components=2) :190.51385259281116\n",
      "stress(n_components=1) :987.9013321892769\n"
     ]
    }
   ],
   "source": [
    "x,y =load_data()\n",
    "test_MDS(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将数据降低至2维\n",
    "def plot_mds(*data):\n",
    "    x,y = data\n",
    "    mds = manifold.MDS(n_components=2)\n",
    "    x_r = mds.fit_transform(x)\n",
    "    \n",
    "    fig = plt.figure()\n",
    "    ax = fig.add_subplot(111)\n",
    "#     colors=((1,0,0),(0,1,0),(0,0,1),(0.5,0.5,0),(0,0.5,0.5),(0.5,0,0.5),(0.4,0.6,0),(0.6,0.4,0),(0,0.6,0.4),(0.5,0.3,0.2),)\n",
    "    colors=((1,0,0),(0,1,0),(0,0,1))\n",
    "    for label,color in zip(np.unique(y),colors):\n",
    "        position =y==label\n",
    "        ax.scatter(x_r[position,0],x_r[position,1],label='target={0}'.format(label),color=color)\n",
    "    \n",
    "    ax.set_xlabel('X[0]')\n",
    "    ax.set_ylabel('Y[0]')\n",
    "    ax.legend(loc='best')\n",
    "    ax.set_title('MDS')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEWCAYAAABmE+CbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X2UXHWd5/H3t5uOsYFlSAccCaYah0AICYnQycYJu3DM8DAqIiIz4/YSGJV2MjBnYN11meSog56cecAZFhzYmBXXQPdxdNEIM4fhITOJQRSwcaI8KYrpQCIDMYSHLIsB+rt/3Oqk0l0P91bVrd+9VZ9Xzj3dVX2r7rduun/f+3u85u6IiIh0hQ5ARESyQQlBREQAJQQRESlSQhAREUAJQUREipQQREQEUEIQEZEiJQSRMsxszMz2mdnMSc//q5m5mfWb2VeL+7xS3B41s78wsyNK9p9mZn9jZjvMbG/xff9H6z+RSG1KCCKVbQM+MvHAzBYAvZP2+Wt3Pxw4CvhDYClwv5kdWvz5nwEDwBLgcOBM4Ifphi1SHyUEkcpuBVaUPL4EuKXcju7+mrv/APgA0EeUHAAWAxvc/ZceGXP3su8hEpoSgkhlDwD/zsxOMrNu4A+A4WovcPdXgHuB/1DyHv/FzP7YzBaYmaUasUgDlBBEqpuoJZwFPAHsjPGaXwIzit//BfBXwCAwCuw0s0tSiFOkYYeEDkAk424FtgDHUaG5qIxZwAsA7v4mcCNwo5m9Ffgo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ZvYOM9tmZjOKj48sPr60uETxnSX7XlJcnvtnZnZJyfObzGxvtaXGRbJA8xBEajCzTwHHu/uQmX2JaDnz7wP/1d3fX9xnBjBKNFHOgYeB09x9T/Hnm4v7B78fhkglqiGI1HYdsNTMrgROB75QZp9zgHvd/YViErgXOLeFMYo0TIvbidTg7q+b2X8D7gLOLj6evFtel1kW2U81BJF4fpdo/Zn5oQMRSYsSgkgNZrYIOIvoFoxXVbjjVu6WWRaZTAlBpIriMsT/E7jS3Z8GrqV8H8LdwNnFUUhHEi1zfnfrIhVpnBKCSHWXAU+7+73FxzcBJwFnlO7k7i8Anye6r8APgM8VnxPJDQ07FamDmZ1JybDTGPtvRsNOJeNUQxCpzz5gfunEtErMbBPRjZJeTz0qkQaohiAiIoBqCCIiUqSEICIigBKCiIgUKSGIiAgA/x+AnijmUFwRkQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x,y =load_data()\n",
    "plot_mds(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
